package com.study.scala

/**
 * @program: spark2.3.2
 * @author: Zhoujian
 * @date: 2022-06-12 14:45
 * @version: 1.0
 * @description: ${description}
 * */
object ForTest {
	def main(args: Array[String]): Unit = {
		val ints = Array(1, 2, 3)
		val ints1 = Array(2, 4)
		val a: Iterator[(Int, Int)] = for(v <- ints.iterator; w <- ints1.iterator) yield (v,w)
		a.foreach(println(_))

		val ints2 = List()
		val b: Array[(Int, Nothing)] = for(v <- ints; w <- ints2) yield (v,w)
		b.foreach(println(_))

//		val iterator = ints1.iterator
//		while (iterator.hasNext){
//			println(1)
//		}

		val map = Map(
			"spark.port.maxRetries" -> 30,
			"spark.serializer" -> "org.apache.spark.serializer.KryoSerializer",
			"spark.scheduler.mode" -> "FAIR",
			"spark.sql.parquet.compression.codec" -> "snappy",
			"spark.sql.files.ignoreCorruptFiles" -> "true",
			"spark.rdd.compress" ->  "true"
		)
		val ints3 = ints.foldLeft(Seq[Int]())((a, b) => a :+ b*2 )
		println(ints3)

//		map.foldLeft()
	}

}
